package com.example.game_level;

import org.andengine.util.adt.pool.GenericPool;



public class BlockPool extends GenericPool {
	 
	    public static BlockPool instance;
	 
	    public static BlockPool sharedBlockPool() {
	        if (instance == null)
	            instance = new BlockPool();
	        return instance;
	    }
	 
	    private BlockPool() {
	        super();
    }
	 
	    @Override
	    protected Blocks onAllocatePoolItem() {
	        return new Blocks();
	    }
	 
	    protected void onHandleObtainItem(final Blocks b) {
	        b.init();
	    }
	    
	    protected void onHandleRecycleItem(final Blocks e) {
	    		    e.sprite.setVisible(false);
	    		    e.sprite.detachSelf();
	    		    e.clean();
	    		}
	}